//package com.vca.common.utils;
//
//import javax.mail.Message;
//import javax.mail.MessagingException;
//import javax.mail.Session;
//import javax.mail.Transport;
//import javax.mail.internet.InternetAddress;
//import javax.mail.internet.MimeMessage;
//import java.util.Properties;
//
//public class SendGmail {
//    public static void main(String[] args) {
//        String host = "smtp.gmail.com";
//        int port = 587;
//        String username = "chenjackson926@gmail.com";
//        String password = "shmily021117";
//
//        Properties props = new Properties();
//        props.put("mail.smtp.auth", "true");
//        props.put("mail.smtp.starttls.enable", "true");
//
//        Session session = Session.getInstance(props);
//
//        try {
//
//            Message message = new MimeMessage(session);
//            message.setFrom(new InternetAddress("chenjackson926@gmail.com"));
//            message.setRecipients(Message.RecipientType.TO, InternetAddress
//                    .parse("3091115941@qq.com"));
//            message.setSubject("Testing Subject");
//            message.setText("Dear Mail Crawler,"
//                    + "\n\n No spam to my email, please!");
//
//            Transport transport = session.getTransport("smtp");
//            transport.connect(host, port, username, password);
//
//            Transport.send(message);
//
//            System.out.println("Done");
//
//        } catch (MessagingException e) {
//            throw new RuntimeException(e);
//        }
//    }
//}
